from django.conf.urls.defaults import *
from django.contrib.auth.views import login, logout
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

# Enable admin
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
        
    # Home page
    (r'^contestron/$', 'contests.views.base'),

    # Problems page               
    (r'^contestron/problems/$', 'contests.views.problems'),

    # Admin Results page
    (r'^contestron/admin_results/$', 'contests.views.allResults'),
                       
    # User results
    (r'^contestron/results/$', 'contests.views.results'),

    # Problem Upload page (just where the file goes to, this is then redirected
    # to the problems page
    (r'^contestron/problem-upload/$', 'contests.views.problem_upload'),

    # Uncomment the admin/doc line below to enable admin documentation:
    (r'^contestron/admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^contestron/admin/', include(admin.site.urls)),

    # Built-in views for login and logout
    (r'^accounts/login/$',  login, {'template_name': 'login.html'}),
    (r'^accounts/logout/$', logout, {'template_name': 'logout.html'}),
)

urlpatterns += staticfiles_urlpatterns()
